<?php
$link =  mysqli_connect("localhost","root","root","2116");
$perPage = $_GET['count'];


$sql = "SELECT * FROM news ORDER BY id LIMIT 0,$perPage";
$res =  mysqli_query($link,$sql);
$arr = [];
while($one=mysqli_fetch_assoc($res)){
	$arr[] = $one;
}


echo json_encode($arr);



?>